home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
U-User Group
/
(k)u9.d64
/
val.lp.proc
< prev
next >
Wrap
Text File
|
2007-02-28
|
435b
|
21 lines
9000 //
9010 // FROM PAGE 287 COMAL HANDBOOK
9020 // IMPROVED, WILL RETURN 0 IF ANY
9030 // NON NUMERIC IN PARAMETER.
9040 //
9050 FUNC VAL(S$) CLOSED
9060 L:=LEN(S$)
9070 FLAG:=0
9080 FOR I:=1 TO L DO
9090 IF S$(I)<"0" OR S$(I)>"9" THEN FLAG:=1
9100 ENDFOR I
9110 IF FLAG THEN RETURN 0
9120 ONES:=ORD(S$(L))-ORD("0")
9130 IF L=1 THEN
9140 RETURN ONES
9150 ELSE
9160 RETURN ONES+VAL(S$(1:L-1))*10
9170 ENDIF
9180 ENDFUNC VAL
9190 //